package cn.com.open.itembank.common.enums;

/**
 * 题库用资源文件类型.
 */
public enum ResourceFileType {
    /**
     * 题库图片
     */
    PICTURE(110),
    /**
     * 题库文档
     */
    FILE(11);


    private int index;

    ResourceFileType(int idx) {
        this.index = idx;
    }

    /**
     * Gets index.
     *
     * @return the index
     */
    public int getIndex() {
        return index;
    }

    /**
     * From value resource file type.
     *
     * @param v the v
     * @return the resource file type
     */
    public static ResourceFileType fromValue(int v) {
        for (ResourceFileType c : ResourceFileType.values()) {
            if (c.getIndex() == v) {
                return c;
            }
        }
        return null;
    }
}
